home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / OpenTptDevLinks.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  3KB  |  113 lines

  1. /*
  2.     File:        OpenTptDevLinks.h
  3.  
  4.     Contains:    Link related constants and structures
  5.  
  6.     Copyright:    © 1993-1996 by Apple Computer, Inc., all rights reserved.
  7.  
  8.  
  9. */
  10.  
  11. #ifndef __OPENTPTDEVLINKS__
  12. #define __OPENTPTDEVLINKS__
  13.  
  14. #ifndef __OPENTPTLINKS__
  15. #include <OpenTptLinks.h>
  16. #endif
  17.  
  18. #ifndef __OPENTPTCOMMON__
  19. #include <OpenTptCommon.h>
  20. #endif
  21.  
  22. /*******************************************************************************
  23. ** Link related constants
  24. ********************************************************************************/
  25.  
  26. enum
  27. {
  28.     kEnetPacketHeaderLength        = (2*k48BitAddrLength)+k8022DLSAPLength,
  29.     //
  30.     // The TSDU for ethernet.
  31.     //
  32.     kEnetTSDU                    = 1514,
  33.     //
  34.     // The TSDU for TokenRing.
  35.     //
  36.     kTokenRingTSDU                = 4458,
  37.     //
  38.     // The TSDU for FDDI.
  39.     //
  40.     kFDDITSDU                    = 4458, //%%% Until someone tells me different
  41.     
  42.     
  43.     k8022SAPLength                = 1,
  44.     
  45.     //
  46.     // define the length of the header portion of an 802.2 packet.
  47.     //
  48.     k8022BasicHeaderLength        = 3, // = SSAP+DSAP+ControlByte
  49.     k8022SNAPHeaderLength        = k8022SNAPLength + k8022BasicHeaderLength
  50. };
  51.  
  52. /*******************************************************************************
  53. ** Address Types recognized by the Enet DLPI
  54. ********************************************************************************/
  55.  
  56. enum EAddrType
  57. {
  58.     keaStandardAddress=0, keaMulticast, keaBroadcast, keaBadAddress,
  59.     keaRawPacketBit = 0x80000000
  60. };
  61.  
  62. /*******************************************************************************
  63. ** Packet Header Structures
  64. ********************************************************************************/
  65.  
  66. struct EnetPacketHeader
  67. {
  68.     UInt8    fDestAddr[k48BitAddrLength];
  69.     UInt8    fSourceAddr[k48BitAddrLength];
  70.     UInt16    fProto;
  71. };
  72.  
  73. typedef struct EnetPacketHeader    EnetPacketHeader;
  74.  
  75. struct T8022Header
  76. {
  77.     UInt8    fDSAP;
  78.     UInt8    fSSAP;
  79.     UInt8    fCtrl;
  80. };
  81.  
  82. typedef struct T8022Header    T8022Header;
  83.  
  84. struct T8022SNAPHeader
  85. {
  86.     UInt8    fDSAP;
  87.     UInt8    fSSAP;
  88.     UInt8    fCtrl;
  89.     UInt8    fSNAP[k8022SNAPLength];
  90. };
  91.  
  92. typedef struct T8022SNAPHeader    T8022SNAPHeader;
  93.  
  94. struct T8022FullPacketHeader
  95. {
  96.     EnetPacketHeader    fEnetPart;
  97.     T8022SNAPHeader        f8022Part;
  98. };
  99.  
  100. typedef struct T8022FullPacketHeader    T8022FullPacketHeader;
  101.  
  102. /*    -------------------------------------------------------------------------
  103.     Define the lengths of the structures above
  104.     ------------------------------------------------------------------------- */
  105. enum
  106. {
  107.     kT8022HeaderLength                = 3,
  108.     kT8022SNAPHeaderLength            = 3 + k8022SNAPLength,
  109.     kT8022FullPacketHeaderLength    = kEnetPacketHeaderLength + kT8022SNAPHeaderLength
  110. };
  111.  
  112.  
  113. #endif